home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 2.9 KB | 98 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWNotifr.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWFound.hpp"
-
- #ifndef FWNOTIFR_H
- #include "FWNotifr.h"
- #endif
-
- #ifndef FWRECEVR_H
- #include "FWRecevr.h"
- #endif
-
- #ifndef FWNOTIFN_H
- #include "FWNotifn.h"
- #endif
-
- #ifndef FWINTERE_H
- #include "FWIntere.h"
- #endif
-
- #ifndef FWNOTDEF_H
- #include "FWNotDef.h"
- #endif
-
- #ifndef FWINTSPC_H
- #include "FWIntSpc.h"
- #endif
-
- #ifndef FWSOMENV_H
- #include "FWSOMEnv.h"
- #endif
-
- //========================================================================================
- // CLASS FW_MNotifier
- //========================================================================================
-
- FW_DEFINE_CLASS_M0(FW_MNotifier)
- FW_DEFINE_AUTO(FW_MNotifier)
-
- //----------------------------------------------------------------------------------------
- // FW_MNotifier::FW_MNotifier
- //----------------------------------------------------------------------------------------
-
- FW_MNotifier::FW_MNotifier() :
- fNotifierID(0)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MNotifier::~FW_MNotifier
- //----------------------------------------------------------------------------------------
-
- FW_MNotifier::~FW_MNotifier()
- {
- FW_CPrivInterestSpace* interestSpace = FW_CPrivInterestSpace::Instance();
-
- // Notify the receivers that this notifier is being deleted
- // (used for instance to remove a RadioCluster when all radio buttons are gone)
- // Only receivers that have added an interest in this message will be notified
- FW_SOMEnvironment ev;
- interestSpace->Notify(ev, FW_CInterest(this, FW_kNotifierDeletedMsg));
- interestSpace->RemoveNotifier(this);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MNotifier::Notify
- //----------------------------------------------------------------------------------------
-
- void FW_MNotifier::Notify(Environment* ev, const FW_CNotification ¬ification)
- {
- FW_CPrivInterestSpace::Instance()->Notify(ev, notification);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MNotifier::Notify
- //----------------------------------------------------------------------------------------
-
- void FW_MNotifier::Notify(Environment* ev, FW_Message message)
- {
- Notify(ev, FW_CInterest(this, message));
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MNotifier::IsConnectedTo
- //----------------------------------------------------------------------------------------
-
- FW_Boolean FW_MNotifier::IsConnectedTo(FW_MReceiver* receiver, const FW_CInterest& interest)
- {
- return (FW_CPrivInterestSpace::Instance()->HasInterest(receiver, interest));
- }
-